'use strict';

module.exports = app => {
  const { router, controller } = app;

  router.get('/admin/auth/user/logout', controller.admin.auth.user.logout);
  router.put('/admin/auth/user', controller.admin.auth.user.updateCurrentUser);
  router.resources('/auth/user', '/admin/auth/user', controller.admin.auth.userCrud);

  router.resources('/auth/role', '/admin/auth/role', controller.admin.auth.roleCrud);

  router.resources('/auth/page', '/admin/auth/page', controller.admin.auth.pageCrud);

  router.resources('/auth/api', '/admin/auth/api', controller.admin.auth.apiCrud);

  router.get('/admin/ali/oss-sign', controller.admin.ali.index.ossSign);
  router.delete('/admin/ali/oss', controller.admin.ali.index.ossDelete);
  router.get('/admin/ali/oss/list', controller.admin.ali.index.ossList);

  router.resources('/admin/banner', '/admin/banner', controller.admin.banner.crud);
  router.get('/admin/banner/dustbin-list', controller.admin.banner.index.dustbinList);
  router.get('/admin/banner/dustbin-restore/:id', controller.admin.banner.index.dustbinRestore);
  router.delete('/admin/banner/dustbin-delete/:id', controller.admin.banner.index.dustbinDelete);

  router.resources('/admin/home-link', '/admin/home-link', controller.admin.homeLink.crud);
  router.get('/admin/home-link/dustbin-list', controller.admin.homeLink.index.dustbinList);
  router.get('/admin/home-link/dustbin-restore/:id', controller.admin.homeLink.index.dustbinRestore);
  router.delete('/admin/home-link/dustbin-delete/:id', controller.admin.homeLink.index.dustbinDelete);

  router.resources('/admin/study-time-line', '/admin/study-time-line', controller.admin.studyTimeLine.crud);
  router.get('/admin/study-time-line/dustbin-list', controller.admin.studyTimeLine.index.dustbinList);
  router.get('/admin/study-time-line/dustbin-restore/:id', controller.admin.studyTimeLine.index.dustbinRestore);
  router.delete('/admin/study-time-line/dustbin-delete/:id', controller.admin.studyTimeLine.index.dustbinDelete);

  router.resources('/admin/study', '/admin/study', controller.admin.study.crud);
  router.get('/admin/study/dustbin-list', controller.admin.study.index.dustbinList);
  router.get('/admin/study/dustbin-restore/:id', controller.admin.study.index.dustbinRestore);
  router.delete('/admin/study/dustbin-delete/:id', controller.admin.study.index.dustbinDelete);

  router.resources('/admin/me', '/admin/me', controller.admin.me.crud);

  router.resources('/admin/feedback', '/admin/feedback', controller.admin.feedback.crud);
  router.get('/admin/feedback/dustbin-list', controller.admin.feedback.index.dustbinList);
  router.get('/admin/feedback/dustbin-restore/:id', controller.admin.feedback.index.dustbinRestore);
  router.delete('/admin/feedback/dustbin-delete/:id', controller.admin.feedback.index.dustbinDelete);

  router.resources('/admin/product', '/admin/product', controller.admin.product.crud);
  router.get('/admin/product/dustbin-list', controller.admin.product.index.dustbinList);
  router.get('/admin/product/dustbin-restore/:id', controller.admin.product.index.dustbinRestore);
  router.delete('/admin/product/dustbin-delete/:id', controller.admin.product.index.dustbinDelete);

  router.resources('/admin/package', '/admin/package', controller.admin.package.crud);
  router.get('/admin/package/dustbin-list', controller.admin.package.index.dustbinList);
  router.get('/admin/package/dustbin-restore/:id', controller.admin.package.index.dustbinRestore);
  router.delete('/admin/package/dustbin-delete/:id', controller.admin.package.index.dustbinDelete);

  router.get('/admin/ecs/all-files', controller.admin.ecs.index.allFiles);
  router.delete('/admin/ecs/delete-file', controller.admin.ecs.index.deleteFile);
  router.delete('/admin/ecs/delete-all', controller.admin.ecs.index.deleteAll);

  router.resources('admin/webProcess', '/admin/logs/web-process', controller.admin.logs.webProcess.crud);
  router.resources('admin/webAjax', '/admin/logs/web-ajax', controller.admin.logs.webAjax.crud);
  router.resources('admin/webError', '/admin/logs/web-error', controller.admin.logs.webError.crud);
  router.resources('admin/serverProcess', '/admin/logs/server-process', controller.admin.logs.serverProcess.crud);
  router.resources('admin/serverError', '/admin/logs/server-error', controller.admin.logs.serverError.crud);

  router.resources('admin/message', '/admin/message', controller.admin.message.crud);
  router.post('/admin/message/batch-delete', controller.admin.message.index.batchDelete);

  router.resources('admin/siteNavigation', '/admin/site-navigation', controller.admin.siteNavigation.crud);
  router.get('/admin/site-navigation/find-sections', controller.admin.siteNavigation.index.findSections);

  router.resources('admin/skills', '/admin/skills', controller.admin.skills.crud);

  router.resources('admin/work', '/admin/work', controller.admin.work.crud);
};
